﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
    <title>接待馈赠管理系统</title>
    <link type="text/css" href="Styles/css/Site.css" rel="stylesheet" />
    <link type="text/css" href="Styles/css/Main.css" rel="stylesheet" />
    <script type="text/javascript">
        var loadPage = function (tabPanel, node) {
            var tab = tabPanel.getItem(node.id);

            if (!tab) {
                tab = tabPanel.add({
                    id: node.id,
                    title: node.text,
                    closable: true,
                    autoLoad: {
                        showMask: true,
                        url: node.attributes.href,
                        mode: "iframe",
                        maskMsg: "Loading " + node.attributes.href + "..."
                    },
                    listeners: {
                        update: {
                            fn: function (tab, cfg) {
                                cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
                            },
                            scope: this,
                            single: true
                        }
                    }
                });
            }

            tabPanel.setActiveTab(tab);
        }
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="X"
        IDMode="Explicit" />
    <ext:Viewport runat="server" Layout="border">
        <Items>
            <ext:Panel runat="server" Header="false" Region="North" Border="false" Html="<div id='header' style='height:32px;'><div class='api-title'>接待馈赠管理系统</div></div>" />
            <ext:TreePanel ID="TreePanel1" runat="server" Region="West" Width="300" Title="导航"
                Icon="ChartOrganisation">
                <Listeners>
                    <Click Handler="if (node.attributes.href) { e.stopEvent(); loadPage(#{Pages}, node); }" />
                </Listeners>
            </ext:TreePanel>
            <ext:TabPanel ID="Pages" runat="server" Region="Center" EnableTabScroll="true" LayoutOnTabChange="true" />
        </Items>
    </ext:Viewport>
</body>
</html>
